public class ForForExercise3_2 {
    public static void main(String[] args) {
        int line = 9;
        int center = line/2;
        for(int i=0; i<line; i++){
            for(int j=0; j<line; j++){
                /*
                横向的步数： |j-center|
                纵向的步数： |i-center|
                 */
                if(Math.abs(j-center) + Math.abs(i-center)<=center){
                    System.out.print("* ");
                }else{
                    System.out.print("  ");
                }
            }
            System.out.println();
        }
    }
}
